#include <iostream>

#include "arrayutil.h"

int main()
{
  const size_t array_size = 6;
  int arr[array_size] = {5, 7, 3, 6, 0, 4};
  std::cout << "before the sort: " << std::endl;
  print_array(arr, 6);
  for (int i = 2; i < array_size; ++i)
  {
    int temp = arr[i];
    int j = i - 1;
    for (; j >= 0; --j)
    {
      if (arr[j] > temp)
      {
	arr[j+1] = arr[j];
      }
      else 
      {
	break;
      }
    }
    arr[j+1] = temp;
  }
  std::cout << "after the sort:" << std::endl;
  print_array(arr, array_size);
  return 1;
}
